- person = membership.person
%tr.row-with-avatar{ id: "membership_#{membership.id}", style: defined?(hide) ? 'display:none' : '' }
  - if @logged_in.can_update?(@group)
    %td
      = check_box_tag 'ids[]', person.try(:id), false, class: 'checkbox simple'
  %td.avatar
    = avatar_tag person
  %td
    = link_to person do
      - if params[:order] == 'last'
        == #{person.last_name}, #{person.first_name}
      - else
        = person.name
    - if @logged_in.can_update?(@group)
      = manually_added_person_in_linked_group_alert_icon(@group, membership)
  - if params[:birthdays]
    %td
      = person.birthday.to_s(:date_without_year) if person.birthday
  - else
    %td
      = membership.created_at.to_s(:date) if membership.created_at
  - if @logged_in.can_update?(@group)
    %td
      = link_to group_membership_path(@group, membership, promote: false), data: { method: :put, remote: true }, id: "#{dom_id(membership)}_admin_demote", title: t('memberships.demote'), style: membership.admin? ? '' : 'display:none' do
        = icon 'fa fa-fw fa-check-square-o'
      = link_to group_membership_path(@group, membership, promote: true), data: { method: :put, remote: true }, id: "#{dom_id(membership)}_admin_promote", title: t('memberships.promote'), style: membership.admin? ? 'display:none' : '' do
        = icon 'fa fa-fw fa-square-o'
    %td
      = link_to group_membership_path(@group, membership, leader: false), data: { method: :put, remote: true }, id: "#{dom_id(membership)}_leader_false", title: t('memberships.leader_remove'), style: membership.leader? ? '' : 'display:none' do
        = icon 'fa fa-fw fa-check-square-o'
      = link_to group_membership_path(@group, membership, leader: true), data: { method: :put, remote: true }, id: "#{dom_id(membership)}_leader_true", title: t('memberships.leader_add'), style: membership.leader? ? 'display:none' : '' do
        = icon 'fa fa-fw fa-square-o'
